﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using kim.Common;
using System.Data;

namespace kim.Web.Admin.honor
{
    public partial class List :UI.ManagePage
    {
        protected string StrPage;
        protected int pageSize, pageIndex;
        protected void Page_Load(object sender, EventArgs e)
        {
            Label1.Text = "人才管理";
            if (!IsPostBack)
            {
                GetStrPage();
            }
        }
        private void GetStrPage()
        {
            pageIndex = KIMRequest.GetInt("p", 1);

            pageSize = 10;
            pageIndex = KIMRequest.GetInt("p", 1);
            kim.BLL.rencai bll = new kim.BLL.rencai();
            int count = SqlDbHelper.GetPageCurrent("rencai", "");
            using (DataSet dt = bll.GetNewsPager(pageIndex, pageSize, "", "InTime Desc", ""))
            {
                rptlist.DataSource = dt;
                rptlist.DataBind();
            }
            StrPage = kim.Common.Utils.OutPageList(pageSize, pageIndex, count, "List.aspx?p=__id__", 8);
        }

        protected void lbtnqx_Click(object sender, CommandEventArgs e)
        {
            LinkButton l = (LinkButton)sender;
            Model.rencai moRencai = new BLL.rencai().GetModel(int.Parse(l.CommandName));
            BLL.rencai bllRencai = new BLL.rencai();
            if (moRencai.IsShow == 1)
            {
                moRencai.IsShow = 0;
                bllRencai.Update(moRencai);
                GetStrPage();
            }
            else
            {
                moRencai.IsShow = 1;
                bllRencai.Update(moRencai);
                GetStrPage();
            }

        }

        
    }
}